<#import "/spring.ftl" as spring />

<#include "/tags/commentTag.ftl">
<#include "/tags/commentBoxTag.ftl">
<#include "/tags/goalHowIDoneTag.ftl">
<#include "/tags/editEntryTag.ftl">
<#include "/tags/goalEntryTag.ftl">

<#if (data.recentEntries?? && data.recentEntries?size> 0)>
	<#list data.recentEntries as entry>
		<#if (entry.entryType==1)>
		<div class="archicle" rel="${entry.id}">
	    	<@goalEntry title=entry.title goalId=entry.goalId goalTitle=entry.goalTitle 
		      		  youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount 
		      		  commentCount=entry.commentCount entryUpdatedSince=entry.updatedSince
				    				ownerName=entry.ownerName body=entry.body entryId=entry.id 
				    			      cheerCount=entry.cheerCount commentCount=entry.commentCount 
				    			      createdDate=entry.createdDate createdMonth=entry.createdMonth 
				    			      createdYear=entry.createdYear ownerAvatar=entry.ownerAvatar imgURL=entry.imgURL
				    			      goalCreatedDate=entry.goalCreatedDate comments=entry.comments/>	        
	     </div>
	    <div class="w6"></div>				
	  	<#else>
	  		<div class="archicle">
				<@howIDone title=entry.title goalId=entry.goalId goalTitle=entry.goalTitle 
	        							youLikeThis=entry.youLikeThis likeCount=entry.likeCount cheerCount=entry.cheerCount 
	        							ownerName=entry.ownerName experience=entry.experience 
	        						   tookType=entry.tookType tookAmount=entry.tookAmount 
	        						   imgURL=entry.imgURL solution=entry.solution 
	        						   entryUpdatedSince=entry.updatedSince
									   tip=entry.tip resources=entry.resources entryId=entry.id 
									   cheerCount=entry.cheerCount commentCount=entry.commentCount
									   createdDate=entry.createdDate createdMonth=entry.createdMonth 
									   createdYear=entry.createdYear ownerAvatar=entry.ownerAvatar 
									   goalCreatedDate=entry.goalCreatedDate comments=entry.comments/>				
			</div>
	  	</#if>
		<#assign lastItem=entry/>
	</#list>
	<#if lastItem?? && lastItem.goalId??>
		<div id="next_page_scroll" class="goalEntryView;;${lastItem.goalId}" rel="${lastItem.sortedValue}" style="float:left"></div>
		<div id="scroll_loader" style="display: none; width: 100%; float: left; padding-top: 30px;">
			<center>
				<img src="${rc.contextPath}/images/loader.gif"/>
			</center>
		</div>
		<div id="show_more" class="wallReadmore">
			<a href="#show_more" id="show_more_button">Hiển thị các bài viết cũ hơn</a>
		</div>
	</#if>		
</#if>	